<#include "/common/taglibs.ftl" />
<#include "/common/taglibs/iconPicker.ftl" />
<meta name="decorator" content="simple"/>
<title><@spring.message code="${entityName!}" /> - <@spring.message code="${op}" /></title>
<div class="m-portlet">
    <div class="m-portlet__head">
        <div class="m-portlet__head-caption">
            <div class="m-portlet__head-title">
                <span class="m-portlet__head-icon">
                    <i class="flaticon-calendar"></i>
                </span>
                <h3 class="m-portlet__head-text m--font-primary">
                <@spring.message code="${entityName!}" /> / <@spring.message code="${op}" />
                <#if op != 'op.view'>
                    （<@spring.message code="reuqired.tips"/>）
                </#if>
                </h3>
            </div>
        </div>
        <div class="m-portlet__head-tools">
        <#include "/common/component/tree/treeNav.ftl" />
        </div>
    </div>
    <!--begin::Form-->
    <form class="m-form m-form--fit m-form--label-align-right" method="post" id="mainForm">
        <div class="m-portlet__body">
            <div class="m-form__content">
            <@showFieldErrors commandName="m" />
                <#include "/common/taglibs/validationMessage.ftl">
            </div>
            <div class="form-group m-form__group row">
                <label class="col-form-label col-lg-3 col-sm-12"><@spring.message code="tree.parent.name"/></label>
                <div class="col-lg-4 col-md-9 col-sm-12">
                    <p class="form-control-static"> <i class="${(parent.icon)!}"></i> ${(parent.name)!} </p>
                </div>
            </div>
            <div class="form-group m-form__group row">
                <label class="col-form-label col-lg-3 col-sm-12"><@spring.message code="tree.child.name"/><span class="required"> * </span></label>
                <div class="col-lg-4 col-md-9 col-sm-12">
                    <input type="text" placeholder="" class="form-control" name="name" value="" required/>
                </div>
            </div>
            <div class="form-group m-form__group row">
                <label class="col-form-label col-lg-3 col-sm-12"><@spring.message code="icon"/></label>
                <div class="col-lg-4 col-md-9 col-sm-12">
                <@iconPicker name="icon" icon=(m.icon)!/>
                </div>
            </div>
            <div class="form-group m-form__group row">
                <label class="col-form-label col-lg-3 col-sm-12"><@spring.message code="tree.show"/></label></label>
                <div class="col-lg-4 col-md-9 col-sm-12">
                <@switchButton inputName="show" on=m.show />
                </div>
            </div>
        </div>
    <#include "/common/component/tree/editFormButtons.ftl" />
    </form>
    <!--end::Form-->
</div>
<page-plugin-style>
<#include "/common/plugins/bootstrap.iconpicker.style.ftl" />
</page-plugin-style>
<page-plugin-script>
<#include "/common/plugins/bootstrap.iconpicker.script.ftl" />
</page-plugin-script>
<page-style></page-style>
<page-script>
    <script>
        jQuery(document).ready(function() {
            var $form = $("#mainForm");
            $.m.form.validate($form, {
                rules: {
                    name: {
                        required: true
                    }
                }
            });
        });
    </script>
</page-script>

